﻿using Nest;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ElasticSearch.Client.Test
{
    class Program
    {
        static void Main(string[] args)
        {

            int pageCount = (int)Math.Ceiling((double)6000 / 5000);
            Console.WriteLine(pageCount);
            Console.ReadKey();
            return;

            var node = new Uri("http://elastic:changeme@112.74.187.140:9200");
            //var settings = new ConnectionSettings(node);
            var settings = new ConnectionSettings(node);
            var client = new ElasticClient(settings);

            //client.CreateIndex("test");
            //基本配置
            IIndexState indexState = new IndexState()
            {
                Settings = new IndexSettings()
                {
                    NumberOfReplicas = 1,//副本数
                    NumberOfShards = 5//分片数
                }
            };
            //client.CreateIndex("test", p => p.InitializeUsing(indexState));

            //创建并Mapping
            client.CreateIndex("test", p => p.InitializeUsing(indexState).Mappings(m => m.Map<Article>(mp => mp.AutoMap())));


        }
    }


}
